package com.kyzh.core.dialog

import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.Fragment
import com.gushenge.core.toast
import com.kyzh.core.R
import com.kyzh.core.utils.copy


private var descDialog:AlertDialog?=null

fun Fragment.showSimpleDialog(title: String, content:String, negative:String){
    descDialog = AlertDialog.Builder(requireContext(), R.style.kyzhGuestLoginDialog)
        .setMessage(content).setTitle(title).setNegativeButton(negative
        ) { dialog, which ->
            content.copy()
            content+"复制成功".toast()
            descDialog?.dismiss()
        }
        .create()

    descDialog?.show()
}
//@SuppressLint("ClickableViewAccessibility")
//private fun Activity.getView(title: String, content: String,listener:()->Unit):View{
//    val binding = DataBindingUtil.inflate<DialogDescBinding>(LayoutInflater.from(this),R.layout.dialog_desc,null,false)
//    binding.tvTitle.text = title
//    binding.tvContent.text = content
//    binding.btSure.setOnClickListener {
//        listener()
//        descDialog?.dismiss()
//    }
//    return binding.root
//}